import { WriterSection } from '../style'
import { connect } from 'react-redux'
const Writer = (props) => {
  let { list } = props
  return (
    <WriterSection>
      <div className="writer-recommond">
        <p>推荐作者</p>
        <p>换一批</p>
      </div>
      {list.map((item, index) => {
        return (
          <div className="writer-item" key={index}>
            <img src={item.get('imgUrl')} alt="" />
            <div className="info">
              <p className="writer-name">{item.get('author')}</p>
              <p className="writer-desc">{item.get('desc')}</p>
            </div>
          </div>
        )
      })}
      <div className="search-all">查看全部</div>
    </WriterSection>
  )
}

const mapStateToProps = (state) => {
  return {
    list: state.getIn(['home', 'writeList']),
  }
}

export default connect(mapStateToProps, null)(Writer)
